import appengine_admin
from models import *

class AdminGauser(appengine_admin.ModelAdmin):
    model = Gauser
    listFields = ('email','firstname', 'lastname', 'username')
    editFields = ('email', 'firstname', 'lastname', 'username', 'currentzip', 'password',
		  'image',  'gender', 'birthday', 'is_public', 'deviceid', 'is_calendar_shared', 'deviceid' )
    readonlyFields = ('created_by', 'modified_by', 'date_created', 'is_active')
    listGql = 'order by date_created desc'

class AdminGabusiness(appengine_admin.ModelAdmin):
    model = Gabusiness
    listFields = ('bizname', 'biztype', 'contactemail', 'contactname', 'phonenumber')
    editFields = ('bizname', 'biztype', 'contactemail', 'contactname', 'supportemail', 'password',
		  'image', 'phonenumber', 'faxnumber', 'ein', 'url',)
    readonlyFields = ('created_by', 'modified_by','date_updated','date_created', 'is_active', 'external_biz_id' )
    listGql = 'order by date_created desc'

class AdminGaevent(appengine_admin.ModelAdmin):
    model = Gaevent
    listFields = ('eventname', 'eventstartdate', 'gabusiness', 'gacategory')
    editFields = ( 'gabusiness', 'gacategory', 'eventname', 'eventdescription', 'eventstartdate', 'eventenddate', #'gacategory1', 'gacategory2',
		  'eventstarttime', 'eventendtime', 'tickets',  'price',  'is_active', 'is_featured', 'eventstartdatetime',
		   'eventenddatetime', 'eventgeopoint',  'supportemail', 'supportphone')
    readonlyFields = ('likecount' ,'eventcategories','created_by', 'modified_by', 'date_updated', 'date_created', 'eventexpiration')
    listGql = 'order by eventstartdate desc'

class AdminGabusinesstype(appengine_admin.ModelAdmin):
    model = Gabusinesstype
    listFields = ('gabusinesstype', )
    editFields = ('gabusinesstype',)
    readonlyFields = ('created_by', 'modified_by', 'date_created','date_updated' )
    listGql = 'order by gabusinesstype desc'

class AdminGabizlocation(appengine_admin.ModelAdmin):
    model = Gabizlocation
    listFields = ('gabusiness','address', 'city', 'state', 'zipcode', )
    editFields = ('gabusiness', 'address', 'city', 'state', 'zipcode', 'geopoint', 'country')
    listGql = 'order by gabusiness desc'

class AdminGaeventlocation(appengine_admin.ModelAdmin):
    model = Gaeventlocation
    listFields = ('gaevent', 'city', 'state', 'zipcode',)
    editFields = ('gaevent', 'address', 'city', 'state', 'zipcode', 'geopoint', 'country', 'eventstartdatetime', 'eventenddatetime',)
    listGql = 'order by gaevent desc'

class AdminGauserfriend(appengine_admin.ModelAdmin):
    model = Gauserfriend
    listFields = ('gauser', 'friend',)
    editFields = ('gauser', 'friend',)
    readonlyFields = ('status', 'created_by', 'modified_by', 'date_created', 'date_updated')

class AdminGauserinbox(appengine_admin.ModelAdmin):
    model = Gauserinbox
    listFields = ('gauserfrom', 'gauserto', 'subject', )
    editFields = ('gauserfrom', 'gauserto', 'subject', 'message',)
    readonlyFields = ('thread_id', 'is_read')

class AdminGausernotification(appengine_admin.ModelAdmin):
    model = Gausernotification
    listFields = ('notificationby', 'notificationfor', 'text')
    editFields = ('notificationby', 'notificationfor', 'text', 'notificationtype', 'event')
    readonlyFields = ('is_read', 'created_by', 'modified_by', 'date_created', 'date_updated')

class AdminGauseraddedevent(appengine_admin.ModelAdmin):
    model = Gauseraddedevent
    listFields = ('gauser', 'gaevent')
    editFields = ('gauser', 'gaevent', 'eventstartdatetime','buyticket', 'is_public', 'is_attending', 'is_favorite',
		  'eventstartdatetime', 'eventstartdate',  'eventenddate', 'eventstarttime' , 'eventendtime' ,'eventgeopoint' )
    readonlyFields = ('eventcategory', 'created_by', 'modified_by', 'date_created', 'date_updated')

class AdminGauseraddedbusiness(appengine_admin.ModelAdmin):
    model = Gauseraddedbusiness
    listFields = ('gauser', 'gabusiness')
    editFields = ('gauser', 'gabusiness',)
    readonlyFields = ('created_by', 'modified_by', 'date_created', 'date_updated')

class AdminGauserlocation(appengine_admin.ModelAdmin):
    model = Gauserlocation
    listFields = ('gauser', 'is_primary', 'city', 'state', 'zipcode')
    editFields = ('gauser', 'is_primary', 'geopoint', 'address', 'city', 'state', 'zipcode', 'country')
    readonlyFields = ('created_by', 'modified_by', 'date_created', 'date_updated')

class AdminGaeventimages(appengine_admin.ModelAdmin):
    model = Gaeventimages
    listFields = ('gaevent',)
    editFields = ('gaevent', 'mainimage', 'image1', 'image2', 'image3', 'image4')
    listGql = 'order by gaevent desc'

class AdminGaeventvideo(appengine_admin.ModelAdmin):
    model = Gaeventvideo
    listFields = ('gaevent',)
    editFields = ('gaevent', 'video')
    listGql = 'order by gaevent desc'

class AdminGausernotificationtypes(appengine_admin.ModelAdmin):
    model = Gausernotificationtypes
    listFields = ('notificationtype', )
    editFields = ('notificationtype', )
    readonlyFields = ('created_by', 'modified_by', 'date_created', 'date_updated')

class AdminGaeventrecommendation(appengine_admin.ModelAdmin):
    model = Gaeventrecommendation
    listFields = ('gaevent', 'recommendationfor', 'recommendationby')
    editFields = ('gaevent', 'recommendationfor', 'recommendationby', )
    readonlyFields = ('created_by', 'modified_by', 'date_created', 'date_updated')
    listGql = 'order by gaevent desc'

class AdminGacategory(appengine_admin.ModelAdmin):
    model = Gacategory
    listFields = ('categoryname',)
    editFields = ('categoryname', 'categoryparentname',)
    readonlyFields = ('created_by', 'modified_by', 'date_created', 'date_updated')
    listGql = 'order by categoryname desc'

class AdminGaeventcategory(appengine_admin.ModelAdmin):
    model = Gaeventcategory
    listFields = ('gaevent', 'gacategory')
    editFields = ('gaevent', 'gacategory','eventstartdatetime', 'eventenddatetime',)
    readonlyFields = ('gaevent', 'gacategory',)
    listGql = 'order by gacategory desc'

class AdminGauserassociation(appengine_admin.ModelAdmin):
    model = Gauserassociation
    listFields = ('gauser', 'associationtype')
    editFields = ('gauser', 'associationtype', 'associationid')
    listGql = 'order by gauser desc'

